module.exports = {

    request: function (req, token) {
        this.options.http._setHeaders.call(this, req, {Authorization: 'Bearer ' + token});
    },

    response: function (res) {
        var headers = this.options.http._getHeaders.call(this, res);
        if(headers.Authorization != undefined){
            token = headers.Authorization;
        }else{
            token = headers.authorization;
        }
        if (token) {
            token = token.split(/Bearer\:?\s?/i);
            return token[token.length > 1 ? 1 : 0].trim();
        }
    }
};
